home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 111 / PC Guia 111.iso / Software / Utils / NetObjects Fusion 7.0 / NOF7Trial.exe / data1.cab / Fsi_-_English / PublishSettings / validpath.js < prev   
Text File  |  2002-06-12  |  493b  |  27 lines

  1. function istalnum(c)
  2. {
  3.     if (c >= '0' && c <= '9')
  4.         return true;
  5.     else if (c >= 'a' && c <= 'z')
  6.         return true;
  7.     else if (c >= 'A' && c <= 'Z')
  8.         return true;
  9.     else
  10.         return false;
  11. }
  12.  
  13. function IsValidAliasPath(sPath)
  14. {
  15.     iLength = sPath.length;
  16.     if (!iLength)
  17.         return false;
  18.     /* Dumb validation: simply check if there is at least one alphanumeric
  19.         character. */
  20.     for(i = 0; i < iLength; i++)
  21.     {
  22.         if(istalnum(sPath.substr(i, 1)))
  23.             return true;
  24.     }
  25.     return false;
  26. }
  27.